package map_set.nowcoder;

//输出描述:
//按照发现顺序，在一行中输出坏掉的键。其中英文字母只输出大写，每个坏键只输出一次。题目保证至少有1个坏键。
//示例1
//输入 7_This_is_a_test<br/>_hs_s_a_es
//输出 7TI

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class BadKeyboard {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String expectedStr = null;
        String actualStr = null;

        while (scanner.hasNext()){
            expectedStr = scanner.next();
            actualStr = scanner.next();
        }
        expectedStr = expectedStr.toUpperCase();
        actualStr = actualStr.toUpperCase();

        Set<Character> actualSet = new HashSet<>();
        for (int i = 0; i < actualStr.length(); i++) {
            char c = actualStr.charAt(i);
            actualSet.add(c);
        }
        Set<Character> set = new HashSet<>();
        for (int i = 0; i < expectedStr.length(); i++) {
            char c = expectedStr.charAt(i);
            if(!actualSet.contains(c)){
                if(set.add(c)){
                    System.out.print(c);
                }
            }
        }
        System.out.println();
    }
}
